<template>
	<tm-app ref="app">
		<tm-navbar title="支付结果" color="orange" linear="right" beforeBack="false" hideHome="false"></tm-navbar>
		<tm-result v-if="flag" color="orange" status="success" title="支付成功" subTitle=" " btnText="查看订单" @click="backOrder()"></tm-result>
		<tm-result v-if="!flag"  color="red" status="error" title="支付失败" subTitle=" " btnText="查看订单" @click="backOrder()"></tm-result>
	</tm-app>
</template>


<script lang="ts" setup>
	import { ref } from "vue"
	import { onLoad } from "@dcloudio/uni-app"
	
	
	const flag = ref(false);
	onLoad((e) => {
		console.log(JSON.stringify(e));
		if(e.flag === "false"){
			flag.value = false;
		}else if(e.flag === "true"){
			flag.value = true;
		}
	})
	
	function backOrder(){
		uni.redirectTo({
			url: '/pages/index/order'
		})
		return false;
	}
</script>